package com.gjy.redis.lua;

import com.gjy.redis.util.RedissonUtil;
import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import redis.clients.jedis.Jedis;

import java.util.UUID;

/**
 * @author gjy
 * @version 1.0
 * @since 2024-05-24 22:08:59
 */
public class StringLuaTest {

    private static final Logger log = LoggerFactory.getLogger(StringLuaTest.class);
    private final Jedis jedis = RedissonUtil.jedisBasic();

    @Test
    public void set() {
        String set = jedis.set(Keys.StringKey.K1, UUID.randomUUID().toString());
        log.info("v: {}", set);
    }

    @Test
    public void get() {
        String s = jedis.get(Keys.StringKey.K1);
        log.info("v: {}", s);
    }

    @Test
    public void del() {
        long del = jedis.del(Keys.StringKey.K1);
        log.info("del: {}", del);
    }

}
